package com.dly.hope.modle;

import com.dly.hope.type.DataStatusEnum;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.hibernate.annotations.Comment;
import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;
import org.hibernate.annotations.GenericGenerator;

import javax.persistence.*;
import java.util.Date;

/**
 * @author linyu.dai
 * @project myserve
 * @description 验证码表
 * @creat 2022/8/28 19:56:26
 */
@Entity
@Table(name = "hope003_validate_code")
@DynamicInsert
@DynamicUpdate

@Data
@NoArgsConstructor
@AllArgsConstructor
public class ValidateCode extends BaseEntity{

    @Id
    @Column(name = "id")
    @GeneratedValue(generator = "uuid")
    @GenericGenerator(name = "uuid", strategy = "org.hibernate.id.UUIDGenerator")
    private String id;

    @Column(name = "code")
    @Comment(value = "验证码")
    private String code;

    @Column(name = "email_to")
    @Comment(value = "接收方")
    private String emailTo;

    @Column(name = "PAA006_USED_S")
    @Comment(value = "使用时间")
    @Temporal(TemporalType.TIMESTAMP)
    private Date usedDate;

    @Column(name = "PAA006_use")
    @Comment(value = "是否使用")
    private Integer use = DataStatusEnum.NO_USER.getCode();

    @Column(name = "PAA006_IS_SEND")
    @Comment(value = "是否发送成功")
    private Boolean send = false;
}
